import request from './request.js'
// 管理端获取全部反馈
export function getAllNews() {
  return request({
    url: '/notifications/getAllNews',
    method: 'GET'
  })
}

// 获取新闻详情
export function testPost(Id) {
  return request({
    url: `/notifications/getDetailNews`,
    data:{
      nId:Id,
    },
    method: 'GET'
  })
}
// 获取新闻详情
export function searchNews(title) {
    return request({
      url: `/notifications/searchByTitle`,
      data:{
        title:title,
      },
      method: 'GET'
    })
  }

  // 修改新闻
export function updateNews(data) {
    return request({
      url: `/notifications/update`,
      data:{
        id:3,
        title:data.title,
        content:data.content,
        publisher:data.department, 
        category:data.category
      },
      method: 'POST'
    })
  }

  // 新增
export function addNews(data) {
    console.log('data',data);
    return request({
      url: `/notifications/create`,
      data:{
        title:data.title,
        content:data.content,
        publisher:data.department, 
        category:data.category
      },
   
      method: 'POST'
    })
  }

